<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php $this->load->view('include/html_head')?>
</head>
<body>
<div id="wrapper">
	<?php $this->load->view('include/header')?>
	<?php $this->load->view('include/menu')?>
	<div id="page">
		<div id="content">
		<?php $this->load->view('include/sub_navi')?>
			<div class="post">
			<form action="<?php echo base_url()?>index.php/frontend/register/index" id='register_form' class="" method=post>
				<p class="meta">用户注册</p>
				<div class="entry">
					<label id='error_msg'><?php echo form_error('c_name_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<label id='error_msg'><?php echo form_error('c_email_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<label id='error_msg'><?php echo form_error('s_name_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<label id='error_msg'><?php echo form_error('s_abbr_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<label id='error_msg'><?php echo form_error('a_stu_num_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<label id='error_msg'><?php echo form_error('a_phone_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<label id='error_msg'><?php echo form_error('a_qq_duplicate_error', '<div class="error">', '</div>'); ?></label>
					<ul class="register_form">
						<li>
							
							<label>用户名:</label>
							<input type='text' id='name' class="validate[required,minSize[4],maxSize[15],custom[onlyLetterNumberWithChinese],ajax[ajaxRegistUser]] text-input" name='name' value='<?php echo set_value("name");?>' />
							<?php echo form_error('name', '<div class="error">', '</div>'); ?>
						</li>
						<li>
							
							<label>密&nbsp;&nbsp;&nbsp;&nbsp;码:</label>
							<input type='password' id='passwords' class="validate[required,minSize[4],maxSize[10]] text-input" name='password' value='<?php echo set_value("password");?>' />
							<?php echo form_error('password', '<div class="error">', '</div>'); ?>
						</li>
						<li>
							
							<label>确认密码:</label>
							<input type='password' id='passconf' class="validate[required,equals[passwords]] text-input" name='passconf' value='<?php echo set_value("passconf");?>' />
							<?php echo form_error('passconf', '<div class="error">', '</div>'); ?>
						</li>
						<li>
							
							<label>电子邮箱:</label>
							<input type='text' id='email' class="validate[required,minSize[4],maxSize[50],custom[email],ajax[ajaxRegistEmail]]" name='email'  value='<?php echo set_value("email");?>' />
							<?php echo form_error('email', '<div class="error">', '</div>'); ?>
						</li>
					</ul>
					<script type="text/javascript">
					$(function(){
						var selected = $('#category_id').val() - 1;
						// Tabs
						$('#tabs').tabs({ selected: selected });
					});
					</script>
					<div id="tabs">  
						<ul>
							<li><a href='#society' style='font-size: 85%;'><span my_type="1" >社团</span></a></li>
							<li><a href='#association' style='font-size: 85%;'><span my_type="2">社联成员</span></a></li>
						</ul>
						<div id='society'>
							<ul>
								<fieldset>
								<legend>社团基本信息</legend>
								<li>
									<label>社团全称:</label>
									<input type='text' id='s_name' class="validate[required,minSize[2],maxSize[15],custom[onlyLetterNumberWithChinese],ajax[ajaxRegistSocietyName]] text-input" name='s_name' value='<?php echo set_value('s_name')?>' />
									<?php echo form_error('s_name', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>社团简称:</label>
									<input type='text' id='abbr' class="validate[required,minSize[2],maxSize[15],custom[onlyLetterNumberWithChinese],ajax[ajaxRegistSocietyAbbr]] text-input" name='abbr' value='<?php echo set_value('abbr')?>' />
									<?php echo form_error('abbr', '<div class="error">', '</div>'); ?>
								</li>
								
									<script>
									//给下拉菜单绑值
									$(function() {
										var society_array = getAllSocietyCategory();
										for (var i= 0; i < society_array.length; i++) {
											$('#s_category').append("<option value=" + (i + 1) + ">" + society_array[i] + "</option>");
										}
									});
									</script>
								<li>
									<label>社团类别:</label>
									<select name="s_category" id="s_category" class="validate[required]">
										<option value="" selected="selected">请选择</option>
									</select>
									<?php echo form_error('s_category', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>创办年份:</label>
									<select name='since' id='since' class="validate[required]">
										<option value="" selected="selected">请选择</option>
										<?php for ($i = date("Y", time()); $i >= date("Y", time()) - 15; $i--):?>
										<option value='<?php echo $i;?>' ><?php echo $i;?>年</option>
										<?php endfor;?>
									</select>
									<?php echo form_error('since', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>社团人数:</label>
									<input type='text' id='member_num' name='member_num' class="validate[required,minSize[1],maxSize[3],custom[integer]] text-input" value='<?php echo set_value('member_num')?>' />&nbsp;人
									<?php echo form_error('member_num', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>社团主页:</label>
									<input type='text' id='web_site' name='web_site' class="validate[required,custom[url]] text-input" value='http://<?php echo set_value('web_site')?>' />
									<?php echo form_error('web_site', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>社团简介:</label><br />
									<textarea id='about' name="about" class="validate[required,minSize[50],maxSize[1000]] text-input" style='width: 480px; height:260px'><?php echo set_value('about') ?></textarea>
									<?php echo form_error('about', '<div class="error">', '</div>'); ?>
								</li>
								</fieldset>
								
								<fieldset>
								<legend>社团负责人信息</legend>
								<li>
									<label>姓名:</label>
									<input type='text' id='contact' name='contact' class="validate[required,minSize[2],maxSize[4],custom[onlyChinese]] text-input" value='<?php echo set_value('contact')?>' />
									<?php echo form_error('contact', '<div class="error">', '</div>'); ?>
								</li>
									<script>
									//给下拉菜单绑值
									$(function() {
										var col_array = getAllCol();
										for (var i= 0; i < col_array.length; i++) {
											$('#contact_col').append("<option value=" + col_array[i][0] + ">" + col_array[i][1] + "</option>");
										}
									});
									</script>
								<li>
									<label>学院:</label>
									<select name='contact_col' id='contact_col' class="validate[required]" onchange="f_change_col_pro(this,document.getElementById('contact_pro'));">
										<option value="" selected="selected">请选择</option>
									</select>
									<?php echo form_error('contact_col', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>专业:</label>
									<select name='contact_pro' id='contact_pro' class="validate[required]">
										<option value="" selected="selected">请选择</option>
									</select>
									<?php echo form_error('contact_pro', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>手机:</label>
									<input type='text' id='contact_phone' name='contact_phone' class="validate[required,custom[mobilenumber],ajax[ajaxRegistContactPhone]] text-input" value='<?php echo set_value('contact_phone')?>' />
									<?php echo form_error('contact_phone', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>QQ :</label>
									<input type='text' id='contact_qq' name='contact_qq' class="validate[required,custom[qq],ajax[ajaxRegistContactQQ]] text-input" value='<?php echo set_value('contact_qq')?>' />
									<?php echo form_error('contact_qq', '<div class="error">', '</div>'); ?>
								</li>
								</fieldset>
								
								<fieldset>
								<legend>社团指导老师信息</legend>
								<li>
									<label>姓名:</label>
									<input type='text' id='t_name' name='t_name' class="validate[required,minSize[2],maxSize[4],custom[onlyChinese]] text-input" value='<?php echo set_value('t_name')?>' />
									<?php echo form_error('t_name', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>手机:</label>
									<input type='text' id='t_phone' name='t_phone' class="validate[required,custom[mobilenumber]] text-input" value='<?php echo set_value('t_phone')?>' />
									<?php echo form_error('t_phone', '<div class="error">', '</div>'); ?>
								</li>
								</fieldset>
							</ul>
						</div>
						<div id='association'>
							<ul>
								<fieldset>
								<legend>社联成员基本信息</legend>
								<li>
									<label>姓名:</label>
									<input type='text' id='a_name' name='a_name' class="validate[required,minSize[2],maxSize[4],custom[onlyChinese]] text-input"  value='<?php echo set_value("a_name");?>' />
									<?php echo form_error('a_name', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
								<div id="radio">
									<label>性别:</label>
									<input type="radio" id="radio1" name="a_gender" class="validate[required] radio" value='1'/><label for="radio1" style='font-size: 85%;'>男</label>
									<input type="radio" id="radio2" name="a_gender" class="validate[required] radio" value='2'/><label for="radio2" style='font-size: 85%;'>女</label>
								</div>
								</li>
								
								<li>
									<label>生日:</label>
									<input type='text' id="datepicker" name='a_birth' class="validate[custom[date]] text-input"/>
								</li>
								
									<script>
									//给下拉菜单绑值
									$(function() {
										var association_array = getAllAssociationCategory();
										for (var i= 0; i < association_array.length; i++) {
											$('#a_category').append("<option value=" + (i + 1) + ">" + association_array[i] + "</option>");
										}
									});
									</script>
								<li>
									<label>部门:</label>
									<select name='a_category' id='a_category' class="validate[required]" >
										<option value="">请选择</option>
									</select>
									<?php echo form_error('a_category', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>学号:</label>
									<input type='text' id='a_stu_num' name='a_stu_num' class="validate[required,minSize[8],maxSize[8],custom[integer],ajax[ajaxRegistAssociationStudentNumber]] text-input" value='<?php echo set_value("a_stu_num");?>'></input>
									<?php echo form_error('a_stu_num', '<div class="error">', '</div>'); ?>
								</li>
								
									<script>
									//给下拉菜单绑值
									$(function() {
										var col_array = getAllCol();
										for (var i= 0; i < col_array.length; i++) {
											$('#a_col').append("<option value=" + col_array[i][0] + ">" + col_array[i][1] + "</option>");
										}
									});
									</script>
								<li>
									<label>学院:</label>
									<select name='a_col' id='a_col' class="validate[required]" onchange="f_change_col_pro(this,document.getElementById('a_pro'));">
										<option value="" selected="selected">请选择</option>
									</select>
									<?php echo form_error('a_col', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>专业:</label>
									<select name='a_pro' id='a_pro' class="validate[required]">
										<option value="" selected="selected">请选择</option>
									</select>
									<?php echo form_error('a_pro', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>手机:</label>
									<input type='text' id='a_phone' name='a_phone' class="validate[required,custom[mobilenumber],ajax[ajaxRegistAssociationPhone]] text-input" value='<?php echo set_value("a_phone");?>'></input>
									<?php echo form_error('a_phone', '<div class="error">', '</div>'); ?>
								</li>
								
								<li>
									<label>QQ :</label>
									<input type='text' id='a_qq' name='a_qq' class="validate[required,custom[qq],ajax[ajaxRegistAssociationQQ]] text-input" value='<?php echo set_value("a_qq");?>'></input>
									<?php echo form_error('a_qq', '<div class="error">', '</div>'); ?>
								</li>
								</fieldset>
					 		</ul>
						</div>
					</div>
					<!-- 指明是社团还是社联的 category_id -->
					<input type='hidden' id='category_id' name="category_id" value="<?php echo set_value('category_id', SOCIETY_UCID)?>"/>
					<button type='submit'>立即注册</button>&nbsp;&nbsp;
					<a class='anchor_button' onclick="history.back(-1);" >返回</a>
				</div>
			</form>
				
			</div>
			<div style="clear: both;">&nbsp;</div>
		</div>
		<!-- end #content -->
		<?php $this->load->view('include/side_bar')?>
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
<?php $this->load->view('include/footer_content')?>
<?php $this->load->view('include/footer')?>
</body>
</html>
